using UnityEngine;

namespace BasicScript.Component
{
	public class ZoomInOutObject : MonoBehaviour
	{
		private float timer1;

		private float timer2;

		private float percent;

		public float speed = 1f;

		public float range;

		public Vector3 originalScale;

		private void Start()
		{
			originalScale = base.transform.localScale;
		}

		private void LateUpdate()
		{
			timer1 += Time.deltaTime * speed;
			timer2 = timer1 % 1f;
			if (timer2 <= 0.5f)
			{
				percent = timer2 / 0.5f;
			}
			else if (timer2 <= 1f)
			{
				percent = (1f - timer2) / 0.5f;
			}
			base.transform.localScale = new Vector3(originalScale.x * (1f + range * percent), originalScale.y * (1f + range * percent), 1f);
		}
	}
}
